Chris Pollett >
Old Classes >
CS156
( Print
View )
Student Corner:
[Submit Sec2]
[Grades Sec2]
[Lecture Notes]
[Discussion Board]
Course Info:
[Texts & Links]
[Topics/Outcomes]
[Outcomes Matrix]
[Grading]
[HW/Quiz Info]
[Exam Info]
[Regrades]
[Honesty]
[Additional Policies]
[Announcements]
HWs and Quizzes:
[Hw1]
[Hw2]
[Hw3]
[Hw4]
[Hw5]
[Quizzes]
Practice Exams:
[Mid 1]
[Mid 2]
[Final]
|
HW#1 --- last modified January 29 2019 04:30:26.
Solution set.
Due date: Sep 18
Files to be submitted:
Hw1.zip
Purpose: To gain experience with problem solving agents and the `A^star` algorithm
Related Course Outcomes:
The main course outcomes covered by this assignment are:
LO1 -- By code or by hand find solution nodes in a state space using the `A^star` algorithm.
Specification:
Nario is an upwardly mobile video game character. When presented a n x m, text-based maze, Nario always strives to climb to the top floor using the A*-algorithm.
Below is an example of the kind of maze Nario might appear in:
#.........
=.======.=
..=.......
====.=====
........=.
=.=====.==
=.........
==.=======
.....
Note:
- The goal will always be in the top left and is represented by #.
- An obstacle is represented by =
- All other squares in the n x m board have a '.'
- The '#' is the goal position.
- In one turn, Nario can move one square to the left, right or up of his current location provided there are no
obstacles in the square he is going to move to.
- Nario can move off the edge of the board to the left or right and will wrap-around to the other side of the board, again, provided
there is no obstacle blocking this move.
- Input boards will always place Nario somewhere on the bottom row of the board.
For this homework you will write a Python program to get Nario to the top of the maze. Here are some guidelines for your program:
Point Breakdown
PEP 8 coding guidelines followed. |
1pt
|
Code is split into reasonable function, classes, etc and is well commented. |
1pt
|
Program reads in input mazes correctly. |
1pt
|
Can find in Python code an implementation of `A^\star` search. |
1pt
|
Can find in Python code an implementations of each of the three mentioned heuristics (1pt each). |
3pts
|
Output corresponds to spec above and should exactly match on examples above. |
1pt
|
Program works on all my tests cases where there is a solution. |
1pt
|
Program works on all my tests cases where there is a no solution. |
1pt
|
Total | 10pts |
|